<?php
/**
 * Created by PhpStorm.
 * User: wudiying
 * Date: 2019/2/2
 * Time: 上午10:32
 */

namespace IMooc;


// 定义接口
interface IDatabase
{
    function connect($host, $user, $password, $dbname);

    function query($query);

    function close();
}

class Database
{
    static private $instance;

    private function __construct()
    {
        // 构造方法弄成私有，就屏蔽了new
    }

    static function getInstance()
    {

        if (self::$instance) {
            return self::$instance;
        }
        self::$instance = new self();
        return self::$instance;
    }

    function where($where)
    {

        return $this;
    }

    function order($order)
    {
        return $this;
    }

    function limit($limit)
    {
        return $this;
    }

}